﻿<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>条码档案信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/js/layui/css/layui.css" rel="stylesheet" />
    <link href="~/X-admin/css/font.css" rel="stylesheet" />
    <link href="~/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/X-admin/js/jquery.min.js"></script>
    <script src="~/X-admin/js/xadmin.js"></script>
    <script src="~/js/framework/sysframework.js"></script>
    <script src="~/js/framework/commonjs.js"></script>
    <script src="~/js/layui/layui.js"></script>

    <script type="text/html" id="barDemo">
        <a title="详情" href="javascript:;" lay-event="print" id="frmView"><i class="layui-icon">&#xe615;</i></a>
    </script>

</head>
<body>
    <div class="layui-fluid">
        <div id="bDiv">
        </div>
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5" name="qForm" id="qForm">

                 
                            <div class="layui-inline layui-show-xs-block">
                                <input type="text" name="proCode" placeholder="存货编码" autocomplete="off" class="layui-input" id="proCode">
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <input type="text" name="proName" placeholder="存货名称" autocomplete="off" class="layui-input" id="proName">
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <select id="wareHouse" name="wareHouse" lay-search class="wareHouse" lay-filter="wareHouse">
                                    <option value="">所属仓库</option>
                                </select>
                            </div>

                       
                 

                        </form>
                    </div>

                    <div class="layui-card-body" id="layui-table-main">
                        <table class="layui-hide" id="list" lay-filter="list"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>

<script>
    var barCodes = "";
    var currPage = 1;//首先默认值为1，防止出错
    function loadData() {
        layui.use('table', function () {
            var conditon = JSON.stringify(FormToJson("qForm"));
  
            var dUrl = "../Summary/GetDataList?dataType=bstl&condition=" + conditon;
            var table = layui.table;
            table.render({
                elem: '#list'
                , height: 'full-140'   //固定高度-即固定表头固定第一行首行
                , cols: [[ //标题栏
                      { field: 'id', title: 'ID', width: 80 }
                    , { field: 'proCode', align: 'center', title: '存货编码', width: '12%', }
                    , { field: 'proName', align: 'center', title: '存货名称', width: '14%' }
                    , { field: 'spec', align: 'center', title: '规 格', width: '14%' }
                    , { field: 'number', align: 'center', title: 'MES库存数', width: '9%' }
                    , { field: 'erpStock', align: 'center', title: 'ERP库存数', width: '9%' }
                    , { field: 'houseName', align: 'center', title: '所属仓库', width: '12%' }
                    , { field: 'right', align: 'center', title: '数据操作', toolbar: '#barDemo', width: 85, fixed: 'right' }
                ]], done: function (res, curr, count) {
                    $("[data-field='id']").css('display', 'none');//隐藏列
                    currPage = curr;
                    TablePowerHide();
                }
                //   , height: $(document).height() - $('#list').offset().top - 20
                , url: dUrl
                , skin: 'row' //表格风格
                , even: true
                , page: { layout: ['count', 'prev', 'page', 'next', 'skip', 'limit'], groups: 1, first: false, last: false }
                , page: true //是否显示分页
                , limits: [20, 35, 50]
                , limit: 20 //每页默认显示的数量
                , id: "tData"
            });
            //监听工具条
            table.on('tool(list)', function (obj) {
                var data = obj.data;
                if (obj.event = 'view') {
                    InfoOpenPage('../Summary/BarStockDetail?proCode=' + data.proCode+"&wareHouse="+data.wareHouse, data.proName + "库存详细", "85%", "90%");
                }

            });
 


        });
    }

    var webCode = "";
    $(function () {
        webCode = getUrlVariable("menuCode");
        BannerData(webCode, "bDiv");
        WareHouseSelect("wareHouse", "");
        loadData();
        $(document).keyup(function (event) {
            if (event.keyCode == 13) {
                loadData();
            }
        })
        var wareCode = "";
    })






</script>
